member = ['路飞', '索隆', '山治', '娜米', '乌索普', '罗宾', '乔巴', '布鲁克', '弗兰奇']
test = list()
for i in member:
    test.append(i)

# test.append("我自己", "NARUTO", "黒崎一護")

test.extend(["NARUTO", "黒崎一護", "NARUTO"])

print(test)
# print(len(test))
print(test.count("NARUTO"))
test.sort(reverse=True)

print(test)
# print(test[10:])
# print(len(test[10:]))
copy_test = test[:]

test.insert(0, "我自己")
test.extend(["哆啦A梦", "面包超人", 12345])


# print(test)
# print("我备份的")
# print(copy_test)


# a = test.pop(0)
# print(a)
# print(test)
# print(len(test))


# empty = []
# print(empty)

# aaa = True
# bbb = False
#
# c = 5 + bbb
# print(c)


# shin_cho = float(input("身高 :"))
# tai_jyu = float(input("体重 :"))
#
#
# judgement = tai_jyu/pow(shin_cho, 2)
# print(judgement)
# if judgement < 18.5:
#     print("过轻")
# elif judgement < 25:
#     print("正常")
# elif judgement < 26:
#     print("过重")
# elif judgement < 32:
#     print("肥胖")
# else:
#     print("严重肥胖")

# 使用多个键值对 存储信息,描述更复杂的信息时
card_list = [{"name": "asdf",
              "QQ": "12345",
              "tel": "110"},
             {"temp": "233333",
              "name": "test"}
             ]

for card_info in card_list:
    print(card_info)

a = "crazy"
b = "crazy"
print(a is b)


aa = "crazy!"
bb = "crazy!"
print(aa is bb)


aaa, bbb = "crazy!", "crazy!"
print(aaa is bbb)


print('a' * 20 is 'aaaaaaaaaaaaaaaaaaaa')
print('a' * 21 is 'aaaaaaaaaaaaaaaaaaaaa')

# 用lambda 匿名函数
num2 = 100
sum1 = lambda num1: num1 + num2;

num2 = 10000
sum2 = lambda num1: num1 + num2;

print(sum1(1))  # 10001
print(sum2(1))  # 10001

# 这主要在于 lambda 表达式中的 num2 是一个自由变量，在运行时绑定值，而不是定义时就绑定，这跟函数的默认值参数定义是不同的。

x = 1

def fun():
    y = 2 + x  # 局部变量
    print(x, y)

fun()

A = [1,2,3,0,0,0]
m = 3
B = [2,5,6]
n = 3
A = A + B
A = list(set(A))
print(A)
try:
    print(A[5])
    print(A[6])
except:
    print("越界")
